#!/usr/bin/env python3
# simple_network_test.py - 简单网络测试
import requests
import time

def test_network():
    print("🔍 测试网络连接...")
    
    urls = [
        "https://www.google.com",
        "https://huggingface.co",
        "https://github.com"
    ]
    
    all_good = True
    
    for url in urls:
        try:
            start = time.time()
            response = requests.get(url, timeout=10)
            duration = time.time() - start
            
            if response.status_code == 200:
                print(f"✅ {url}: {duration:.2f}s")
            else:
                print(f"❌ {url}: HTTP {response.status_code}")
                all_good = False
        except Exception as e:
            print(f"❌ {url}: {e}")
            all_good = False
    
    if all_good:
        print("\n🎉 网络连接正常！")
    else:
        print("\n⚠️  网络可能有问题，请检查连接")

if __name__ == "__main__":
    test_network()
